version: "3"

services:
  bd_bot:
    container_name: bd_bot
    command: >
      sh -c "poetry run python main.py"
    build: .
    volumes:
      - .:/usr/src/bd_bot
    environment:
      - POSTGRES_DB=bdbot
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - BOT_TOKEN=${BOT_TOKEN}

  postgres:
    container_name: postgres
    image: postgres:latest
    environment:
      POSTGRES_DB: bdbot
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    ports:
      - "5432:5432"